

#ifndef UC_GEARC2D_H
#define UC_GEARC2D_H

#include "zgecurv2d.h"
#include "zgepnt2d.h"
#include "zgevec2d.h"
#pragma pack (push, 8)

class UcGeLine2d;
class UcGeLinearEnt2d;

class
GE_DLLEXPIMPORT
UcGeCircArc2d : public UcGeCurve2d
{
public:
    UcGeCircArc2d();
    UcGeCircArc2d(const UcGeCircArc2d& arc);
    UcGeCircArc2d(const UcGePoint2d& cent, double radius);
    UcGeCircArc2d(const UcGePoint2d& cent, double radius,
                  double startAngle, double endAngle,
                  const UcGeVector2d& refVec = UcGeVector2d::kXAxis,
                  ZSoft::Boolean isClockWise = ZSoft::kFalse);
    UcGeCircArc2d(const UcGePoint2d& startPoint, const UcGePoint2d& point, 
                  const UcGePoint2d& endPoint);

    UcGeCircArc2d(const UcGePoint2d& startPoint, const UcGePoint2d& endPoint, double bulge, 
                  ZSoft::Boolean bulgeFlag = ZSoft::kTrue);

    ZSoft::Boolean intersectWith  (const UcGeLinearEnt2d& line, int& intn,
                                   UcGePoint2d& p1, UcGePoint2d& p2,
                                   const UcGeTol& tol = UcGeContext::gTol) const;
    ZSoft::Boolean intersectWith  (const UcGeCircArc2d& arc, int& intn,
                                   UcGePoint2d& p1, UcGePoint2d& p2,
                                   const UcGeTol& tol = UcGeContext::gTol) const;

    ZSoft::Boolean tangent        (const UcGePoint2d& pnt, UcGeLine2d& line,
                                   const UcGeTol& tol = UcGeContext::gTol) const;
    ZSoft::Boolean tangent        (const UcGePoint2d& pnt, UcGeLine2d& line,
                                   const UcGeTol& tol, UcGeError& error) const;

    ZSoft::Boolean isInside       (const UcGePoint2d& pnt,
                                   const UcGeTol& tol = UcGeContext::gTol) const;

    UcGePoint2d    center         () const;
    double         radius         () const;
    double         startAng       () const;
    double         endAng         () const;
    ZSoft::Boolean isClockWise    () const;
    UcGeVector2d   refVec         () const;
    UcGePoint2d    startPoint     () const;
    UcGePoint2d    endPoint       () const;

    UcGeCircArc2d& setCenter      (const UcGePoint2d& cent);
    UcGeCircArc2d& setRadius      (double radius);
    UcGeCircArc2d& setAngles      (double startAng, double endAng);
    UcGeCircArc2d& setToComplement();
    UcGeCircArc2d& setRefVec      (const UcGeVector2d& vec);
    UcGeCircArc2d& set            (const UcGePoint2d& cent, double radius);
    UcGeCircArc2d& set            (const UcGePoint2d& cent, double radius,
                                   double ang1, double ang2,
                                   const UcGeVector2d& refVec =
                                   UcGeVector2d::kXAxis,
                                   ZSoft::Boolean isClockWise = ZSoft::kFalse);
    UcGeCircArc2d& set            (const UcGePoint2d& startPoint, const UcGePoint2d& pnt,
                                   const UcGePoint2d& endPoint);
    UcGeCircArc2d& set            (const UcGePoint2d& startPoint, const UcGePoint2d& pnt,
                                   const UcGePoint2d& endPoint, UcGeError& error);

    UcGeCircArc2d& set            (const UcGePoint2d& startPoint, 
                                   const UcGePoint2d& endPoint,
                                   double bulge, ZSoft::Boolean bulgeFlag = ZSoft::kTrue);
    UcGeCircArc2d& set            (const UcGeCurve2d& curve1,
                                   const UcGeCurve2d& curve2,
                                   double radius, double& param1, double& param2,
								   ZSoft::Boolean& success);

    UcGeCircArc2d& set            (const UcGeCurve2d& curve1,
                                   const UcGeCurve2d& curve2,
                                   const UcGeCurve2d& curve3,
                                   double& param1, double& param2, double& param3,
								   ZSoft::Boolean& success);

    UcGeCircArc2d& operator =     (const UcGeCircArc2d& arc);
};

#pragma pack (pop)
#endif
